import requests

# 使用代理获取百度首页
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36'
}
#  定义代理的字典
proxies = {

    'http': 'http://127.0.0.1:80'
    ###url
}

# 使用代理给服务器发送请求
response = requests.get('###url', proxies=proxies, headers=headers)
# 获取状态
print(response.status_code)
print(response.content.decode())
fo=open("requestsgetproxy.html","wb")
fo.write(response.content)
fo.close